package com.lee.controller;

import com.lee.common.AppResult;
import com.lee.service.AbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("/abstract")
public class AbstractController {
    @Autowired
    private AbstractService abstractService;

    @GetMapping("get")
    public AppResult getAbstract(@RequestParam("id") @NotNull Long id) {
        return abstractService.getAbstract(id);
    }

    @PostMapping("generate")
    public AppResult generateAbstract(@RequestParam("id") @NotNull Long id) {
        return abstractService.generateAbstract(id);
    }
}
